﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using RPGMapa.Data;
using RPGMapa.Controls;
using System.Windows.Forms;

namespace RPGMapa.Tools
{
    public class Eraser : BasicTool
    {
        private Tile cleanTile;
        public Eraser()
        {
            Bitmap alphaTile = new Bitmap(5, 5);
            (Graphics.FromImage(alphaTile)).Clear(
                Color.FromArgb(
                0, 
                Color.SandyBrown.R, 
                Color.SandyBrown.G, 
                Color.SandyBrown.B));
            cleanTile = new Tile(alphaTile, Vector2.Zero());
        }

        public override void MouseClick(Tile tile, Size tileSize, Vector2 tilePos, MapPainter map)
        {
            map.ProcessTile(cleanTile, tilePos, tileSize);
        }

        public override void MouseMove_Dragging(Tile tile, Size tileSize, Vector2 tilePos, MapPainter map)
        {
            map.ProcessTile(cleanTile, tilePos, tileSize);
        }
    }
}
